package userInterface;

import javax.swing.JPanel;
import java.awt.GridLayout;
import javax.swing.JButton;

import org.apache.cassandra.cli.CliParser.exitStatement_return;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class LogoutPanel extends JPanel {

	private MainFrame frameToBeClosed;
	/**
	 * Create the panel.
	 */
	public LogoutPanel(MainFrame frame) {
		setLayout(null);
		this.frameToBeClosed = frame;
		JPanel panel = new JPanel();
		panel.setBounds(10, 11, 430, 54);
		add(panel);
		panel.setLayout(new GridLayout(1, 0, 0, 0));
		
		JButton btnNewButton = new JButton("Log Out");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				LoginFrame newLogin = new LoginFrame();
				newLogin.setVisible(true);
				frameToBeClosed.dispose();
			}
		});
		panel.add(btnNewButton);

	}

}
